<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>08_形参默认值</title>
</head>
<body>
<!--
    * 形参的默认值----当不传入参数的时候默认使用形参里的默认值
    function Point(x = 1,y = 2) {
    this.x = x;
    this.y = y;
    }
-->
<script type="text/javascript">
    function Point(x = 1, y = 2) {
        this.x = x;
        this.y = y;
    }

    var p1 = new Point(33, 44);
    var p2 = new Point();
    console.log(p1, p2);

</script>

</body>
</html>